//
//  JBBasicDataTableViewCell.m
//  JustBen
//
//  Created by YongbinZhang on 10/29/13.
//  Copyright (c) 2013 ZhangYongbin(JustBen). All rights reserved.
//

#import "JBBasicDataTableViewCell.h"

static CGFloat const kDefaultTableViewCellHeight = 44.0f;

@implementation JBBasicDataTableViewCell

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    
    return self;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    
    return self;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        self.backgroundColor = [UIColor clearColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;        
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


//  通过数据设置Cell
- (void)setCellData:(NSObject *)cellData
{
    if (cellData) {
        if (![cellData isEqual:_cellData]) {
            _cellData = cellData;
            
            [self performSelector:@selector(updateViewContents)];
        }
    }
}


#pragma mark - 模版方法
//  根据cellData更新View
- (void)updateViewContents
{
    //  TO DO
}


#pragma mark - 模版方法
//  cell的高度
+ (CGFloat)cellHeightAtIndexPath:(NSIndexPath *)indexPath WithCellData:(id)cellData
{
    //  TO DO
    return kDefaultTableViewCellHeight;
}

@end
